<!DOCTYPE html>
<html lang="en">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="git_tor"/>




  <meta name="keywords" content="git, Hexo" />










  <link rel="alternate" href="/blog/default" title="Hexo" >




  <link rel="shortcut icon" type="image/x-icon" href="/blog/favicon.ico?v=2.9.0" />



<link rel="canonical" href="https://gitee.com/LucasGitee/blog/2021/04/01/git-tor/"/>



  <link rel="stylesheet" type="text/css" href="/blog/lib/fancybox/jquery.fancybox.css" />




  <link rel="stylesheet" type="text/css" href="/blog/lib/nprogress/nprogress.min.css" />



<link rel="stylesheet" type="text/css" href="/blog/css/style.css?v=2.9.0" />



  



  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>








<script>
  window.config = {"since":2015,"favicon":"/favicon.ico","rss":"default","menu":{"Home":"/"},"color":"Default","toc":true,"fancybox":true,"pjax":true,"copyright":{"enable":true,"license":"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by-nc/4.0/\" target=\"_blank\">知识共享署名-非商业性使用 4.0 国际许可协议</a>"},"reward":{"enable":false,"qrCode":{"wechat":null,"alipay":null}},"social":{"email":"your@email.com","stack-overflow":null,"twitter":null,"facebook":null,"linkedin":null,"google":null,"github":"https://github.com/ahonn","weibo":null,"zhihu":null,"douban":null,"pocket":null,"tumblr":null,"instagram":null},"leancloud":{"app_id":null,"app_key":null},"baidu_analytics":null,"baidu_verification":null,"google_analytics":null,"google_verification":null,"disqus_shortname":null,"changyan":{"appid":null,"appkey":null},"livere_datauid":null,"version":"2.9.0"};
</script>

    <title> git_tor - Hexo </title>
  <meta name="generator" content="Hexo 5.4.0"></head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/blog/." class="logo">Hexo</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/blog/">
        <li class="mobile-menu-item">
          
          
            Home
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/blog/." class="logo">Hexo</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/blog/">
            
            
              Home
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          git_tor
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2021-04-01
        </span>
        
        
      </div>
    </header>

    
    
  <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">Contents</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#config"><span class="toc-text">config</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#push"><span class="toc-text">push</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#branch"><span class="toc-text">branch</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%9F%A5%E7%9C%8B%E5%BD%93%E5%89%8D%E7%9B%AE%E5%BD%95%E4%B8%8B%E5%8F%97%E7%89%88%E6%9C%AC%E6%8E%A7%E5%88%B6%E7%9A%84%E6%96%87%E4%BB%B6"><span class="toc-text">查看当前目录下受版本控制的文件</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#alias-%E5%88%AB%E5%90%8D"><span class="toc-text">alias 别名</span></a>
    </div>
  </div>



    <div class="post-content">
      
        <h2 id="config"><a href="#config" class="headerlink" title="config"></a>config</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br></pre></td><td class="code"><pre><span class="line"># 保存登录，免去每次都要输入密码的问题（重要）</span><br><span class="line">git config –global credential.helper store</span><br><span class="line"></span><br><span class="line"># 查看git配置信息</span><br><span class="line">git config --list</span><br><span class="line">git config --global --list</span><br><span class="line"></span><br><span class="line"># 查看git用户名、密码、邮箱的配置</span><br><span class="line">$ git config user.name</span><br><span class="line">$ git config user.password</span><br><span class="line">$ git config user.email</span><br><span class="line"></span><br><span class="line"># 设置git用户名、密码、邮箱的配置</span><br><span class="line">$ git config user.name &quot;freedom&quot;</span><br><span class="line">$ git config user.password &quot;123456&quot;</span><br><span class="line">$ git config user.email &quot;1548429568@qq.com&quot;</span><br><span class="line"></span><br><span class="line"># （全局配置）设置git用户名、密码、邮箱的配置</span><br><span class="line">$ git config --global user.name 用户命</span><br><span class="line">$ git config --global user.name freedom</span><br><span class="line">$ git config --global user.password 密码</span><br><span class="line">$ git config --global user.password abc0506abc</span><br><span class="line">$ git config --global user.password 邮箱</span><br><span class="line">$ git config --global user.email &quot;1548429568@qq.com&quot;</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>

<h2 id="push"><a href="#push" class="headerlink" title="push"></a>push</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">#语法</span><br><span class="line">git push origin master:posts</span><br></pre></td></tr></table></figure>

<h2 id="branch"><a href="#branch" class="headerlink" title="branch"></a>branch</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">#查看所有分支</span><br><span class="line">git branch -a </span><br><span class="line"></span><br><span class="line">#输入命令切换分支</span><br><span class="line">$ git checkout -b zhanghanlun origin&#x2F;zhanghanlun</span><br></pre></td></tr></table></figure>

<h2 id="查看当前目录下受版本控制的文件"><a href="#查看当前目录下受版本控制的文件" class="headerlink" title="查看当前目录下受版本控制的文件"></a>查看当前目录下受版本控制的文件</h2><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git ls-files</span><br></pre></td></tr></table></figure>

<h1 id="alias-别名"><a href="#alias-别名" class="headerlink" title="alias 别名"></a>alias 别名</h1><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br></pre></td><td class="code"><pre><span class="line"># git config全局配置文件 路径：~&#x2F;.gitconfig</span><br><span class="line"></span><br><span class="line"># 举例</span><br><span class="line">[aliass]</span><br><span class="line">    ch &#x3D; checkou</span><br><span class="line">	st &#x3D; status</span><br><span class="line">	staust &#x3D; &#39;gitst&#39;</span><br><span class="line">	cf &#x3D; config</span><br><span class="line">	ck &#x3D; checkout</span><br><span class="line">	ft &#x3D; fetch</span><br><span class="line">	fh &#x3D; fetch</span><br><span class="line">	br &#x3D; branch</span><br><span class="line">	brv &#x3D; branch --v</span><br><span class="line">	geturl &#x3D; config --get remote.origin.url</span><br><span class="line">	bs &#x3D; bisect</span><br><span class="line">	lg &#x3D; log</span><br><span class="line">	cfg &#x3D; config --global</span><br><span class="line">	cfga &#x3D; config --global alias.</span><br><span class="line">	pull &#x3D; pl</span><br><span class="line">	pl &#x3D; pull --rebase</span><br><span class="line">	cm &#x3D; commit -c HEAD</span><br><span class="line">	ps &#x3D; push</span><br><span class="line">	lsr &#x3D; ls-remote --heads</span><br><span class="line">	udc &#x3D; reset HEAD~</span><br><span class="line">	ftg &#x3D; fetch --tags</span><br><span class="line">	am &#x3D; commit -amend</span><br><span class="line">	cmd &#x3D; commit --amend</span><br><span class="line">	rsh &#x3D; reset HEAD~</span><br><span class="line">	cmi &#x3D; commit --interactive -c HEAD --reset-author</span><br><span class="line">	i &#x3D; --interactive</span><br><span class="line">	rss &#x3D; reset --soft</span><br><span class="line">	rmc &#x3D; rm --cached</span><br><span class="line">	cp &#x3D; cherry-pick</span><br><span class="line">	cpx &#x3D; cherry-pick -x</span><br><span class="line">	bl &#x3D; blame</span><br><span class="line">	gk &#x3D; gitk</span><br><span class="line">	ltn &#x3D; ls-tree -r HEAD~ --name-only</span><br><span class="line">	lt &#x3D; ls-tree -r HEAD~ --name-only</span><br><span class="line">	ltng &#x3D; ls-tree -r HEAD~ --name-only |grep</span><br><span class="line">	lgd &#x3D; log -p --full-diff</span><br><span class="line">	bcm &#x3D; &quot;branch -a --contains &quot;</span><br><span class="line">	brc &#x3D; branch -a --contains</span><br><span class="line">	tagc &#x3D; tag --contain</span><br></pre></td></tr></table></figure>

<p>mv命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">#git mv 命令用于移动或重命名一个文件、目录或软连接。</span><br><span class="line">git mv [file] [newfile]</span><br><span class="line"></span><br><span class="line">如果新但文件名已经存在，但还是要重命名它，可以使用 -f 参数：</span><br><span class="line">git mv -f [file] [newfile]</span><br><span class="line"></span><br><span class="line">#例子</span><br><span class="line">#我们可以添加一个 README 文件（如果没有的话）：</span><br><span class="line">git add README </span><br><span class="line"></span><br><span class="line">#重名了操作</span><br><span class="line">git mv README  README.md</span><br><span class="line">ls</span><br><span class="line">README.md</span><br><span class="line"></span><br></pre></td></tr></table></figure>
      
    </div>

    
      
      

  <div class="post-copyright">
    <p class="copyright-item">
      <span>Author: </span>
      <a href="https://gitee.com/LucasGitee/blog">Lucas</a>
    </p>
    <p class="copyright-item">
      <span>Link: </span>
      <a href="https://gitee.com/LucasGitee/blog/2021/04/01/git-tor/">https://gitee.com/LucasGitee/blog/2021/04/01/git-tor/</a>
    </p>
    <p class="copyright-item">
      <span>License: </span>
      
      <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/blog/tags/git/">git</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/blog/2021/04/01/hexo/">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">hexo</span>
        <span class="prev-text nav-mobile">Prev</span>
      </a>
    
    
      <a class="next" href="/blog/2021/04/01/Markdown_yufa/">
        <span class="next-text nav-default">Markdown语法</span>
        <span class="prev-text nav-mobile">Next</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
    
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:your@email.com" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a target="_blank" rel="noopener" href="https://github.com/ahonn" class="iconfont icon-github" title="github"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
    
    
      
      <a href="/blog/atom.xml" class="iconfont icon-rss" title="rss"></a>
    
  </div>


<div class="copyright">
  <span class="power-by">
    Powered by <a class="hexo-link" target="_blank" rel="noopener" href="https://hexo.io/">Hexo</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Theme - 
    <a class="theme-link" target="_blank" rel="noopener" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>

  <span class="copyright-year">
    
    &copy; 
     
      2015 - 
    
    2021

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">Lucas</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  

  



    
  



  
  





  
    <script type="text/javascript" src="/blog/lib/jquery/jquery.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/fancybox/jquery.fancybox.pack.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/pjax/jquery.pjax.min.js"></script>
  

  
    <script type="text/javascript" src="/blog/lib/nprogress/nprogress.min.js"></script>
  


    <script type="text/javascript" src="/blog/js/src/even.js?v=2.9.0"></script>

  </body>
</html>
